#include <bits/stdc++.h>
using namespace std;

int main()
{
    map<int, int> reader;
    int n;
    cin >> n;
    while(n--)
    {
        int temp;
        cin >> temp;
        temp = ++reader[temp];
        cout << temp << " ";
    }
    return 0;
}
